/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Common;

import java.io.Serializable;
import java.util.Objects;

/**
 *
 * @author ryuk
 */
public class EmailDetail implements Serializable  {
    public String subject;
    public String body;

    public EmailDetail() {
    }
    
    

    public EmailDetail(String subject, String body) {
        this.subject = subject;
        this.body = body;
    }
    
    @Override
    public String toString()
    {
        return "subjet: "+subject+", body: "+body;
    }    
    
    public String getEmailContent() {
        return "\n"  +
               "------------------------------------------------" +
               "\n"  + 
               "Asunto: " + subject +
               "\n"  + 
               "------------------------------------------------" +
               "\n"  + 
               "\n"  + 
               body  +
                "\n" +
                "\n" +
               "-------------------------«Simple-Email-System-©»" +
               "\n"; 
    }

    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    public String getBody() {
        return body;
    }

    public void setBody(String body) {
        this.body = body;
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 53 * hash + Objects.hashCode(this.subject);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final EmailDetail other = (EmailDetail) obj;
        if (!Objects.equals(this.subject, other.subject)) {
            return false;
        }
        return true;
    }
    
}
